<?php 

class OController extends Controller
{
	public $mainMenu = array();
	
	/**
	 * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
	 * using two-column layout. See 'protected/views/layouts/column2.php'.
	 */
	public $layout='//layouts/column2';
	
	public function __construct($id, $module=null) {
		parent::__construct($id, $module);
		if (empty(Yii::app()->user->id)) {
			$this->redirect(array('site/login'));
		} 
		$this->mainMenu = array(
			array('label' => 'Overview', 'url' => array('owner/account/overview')),
			array('label' => 'Links & Codes', 'url' => array('owner/adv/overview')),
			array('label' => 'Reports', 'url' => array('owner/report/validMembers')),
			array('label' => 'Payments', 'url' => array('owner/payment/rates')),
			array('label' => 'FAQs', 'url' => array('site/faqs')),
			array('label' => 'Tips', 'url' => array('site/tips')),
			array('label' => 'Account Info', 'url' => array('owner/account/info')),
			array('label' => 'Contact Us', 'url' => array('site/contact')),
			array('label'=>'Logout', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
		);
	}
}